﻿<UserControl x:Class="GamePlugin.Controls.SearchInfoList"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="500" d:DesignWidth="400"
             Name="SearchInforList"
             >
    <Grid Width="400" Height="494">
        <Grid.RowDefinitions>
            <RowDefinition Height="343" />
            <RowDefinition Height="37" />
            <RowDefinition Height="118" />
            <RowDefinition Height="100*" />
        </Grid.RowDefinitions>
        <ListBox Height="325" HorizontalAlignment="Left" Margin="23,0,0,0" Name="searchListBox" 
                 ItemsSource="{Binding Children}" VerticalAlignment="Top" Width="377" SelectionChanged="searchListBox_SelectionChanged">
            
            <ListBox.ItemContainerStyle>
                <!-- This Style binds a TreeViewItem to a TreeItem. -->
                <Style TargetType="{x:Type ListBoxItem}">
                    <Style.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter Property="FontWeight" Value="Bold" />
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </ListBox.ItemContainerStyle>
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding Path=SearchInfoName}"/>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        <Button Content="添加" Height="23" HorizontalAlignment="Left" Margin="12,12,0,0" Name="AddButton" VerticalAlignment="Top" Width="75" Grid.Row="2" Click="AddButton_Click" />
        <Button Content="删除" Height="23" HorizontalAlignment="Left" Margin="12,51,0,0" Name="DeleteButton" VerticalAlignment="Top" Width="75" Grid.Row="2" Click="DeleteButton_Click" />
        <Button Content="存储" Height="23" HorizontalAlignment="Right" Margin="0,12,12,0" Name="SaveButton" VerticalAlignment="Top" Width="75" Grid.Row="2" Click="SaveButton_Click" />
        <Label Content="搜索项名称" Height="28" HorizontalAlignment="Left" Margin="23,1,0,0" Name="label1" VerticalAlignment="Top" Grid.Row="1" />
        <TextBox Grid.Row="1" Height="21" HorizontalAlignment="Left" Margin="107,2,0,0" Name="textBox1" VerticalAlignment="Top" Width="293" 
                 DataContext="{Binding Path=SelectedItem, ElementName=SearchInforList}" Text="重命名" />
        <Button Content="读入" Grid.Row="2" Height="23" HorizontalAlignment="Left" Margin="313,51,0,0" Name="LoadButton" VerticalAlignment="Top" Width="75" Click="LoadButton_Click" />
        <Button Content="修改" Height="23" HorizontalAlignment="Right" Margin="0,12,218,0" Name="ModifyButton" VerticalAlignment="Top" Width="75" Grid.Row="2" Click="ModifyData_Click" />
        <Button Content="刷新" Grid.Row="2" Height="23" HorizontalAlignment="Left" Margin="107,51,0,0" Name="FreshButton" VerticalAlignment="Top" Width="75" Click="FreshButton_Click" />
        <Button Content="上移" Grid.Row="2" Height="23" HorizontalAlignment="Left" Margin="200,12,0,0" Name="MoveUpButton" VerticalAlignment="Top" Width="75" Click="MoveUpButton_Click" />
        <Button Content="下移" Grid.Row="2" Height="23" HorizontalAlignment="Left" Margin="200,51,0,0" Name="MoveDownButton" VerticalAlignment="Top" Width="75" Click="MoveDownButton_Click" />
        <Button Content="自動排序" Grid.Row="2" Height="23" HorizontalAlignment="Left" Margin="201,94,0,0" Name="AutoSortButton" VerticalAlignment="Top" Width="75" Click="AutoSortButton_Click" />
    </Grid>
</UserControl>
